package com.demo.blog.service;

import com.demo.blog.mapper.BlogInfoMapper;
import com.demo.blog.model.Blog;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 22652
 * Date: 2024-07-24
 * Time: 11:49
 */
@Service
public class BlogService {

    @Autowired
    private BlogInfoMapper blogInfoMapper;

    public List<Blog> getBlogList() {
        return blogInfoMapper.queryBlogList();
    }

    public Blog getBlogDetail(Integer id) {
        return blogInfoMapper.queryById(id);
    }

    public Integer insertBlog(Blog blogInfo) {
        return blogInfoMapper.insertBlog(blogInfo);
    }

    public Integer updateBlog(Blog blogInfo) {
        return blogInfoMapper.updateBlog(blogInfo);
    }

    public Integer delete(Integer blogId) {
        return blogInfoMapper.deleteBlog(blogId);
    }
}
